// a.vue
<template>
    <div>
        <b ref="bRef" :test="aa"></b>
    </div>
</template>

<script setup>
import b from "./b.vue"
const aa = ref("123")
const bRef = ref(null)
bRef.value.handleTest()
</script>


//b.vue
<template>
    {{ props.test }}
</template>

<script setup>
const props = defineProps({
    test: String
})

function handleTest() {
    console.log("handleTest")
}

defineExpose({handleTest})
</script>